🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / app / src / main / java / com / geeksville / mesh / repository / bluetooth / BluetoothLeScanner.kt
Displaying Raw • Download
app/src/main/java/com/geeksville/mesh/repository/bluetooth/BluetoothLeScanner.kt ui_message_list (be3f882f) Text, 1.79 KB
T8b949e/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787com.geeksville.mesh.repository.bluetooth
Tff7b72import T7ee787android.bluetooth.le.BluetoothLeScanner
Tff7b72import T7ee787android.bluetooth.le.ScanCallback
Tff7b72import T7ee787android.bluetooth.le.ScanFilter
Tff7b72import T7ee787android.bluetooth.le.ScanResult
Tff7b72import T7ee787android.bluetooth.le.ScanSettings
Tff7b72import T7ee787androidx.annotation.RequiresPermission
Tff7b72import T7ee787kotlinx.coroutines.cancel
Tff7b72import T7ee787kotlinx.coroutines.channels.awaitClose
Tff7b72import T7ee787kotlinx.coroutines.flow.Flow
Tff7b72import T7ee787kotlinx.coroutines.flow.callbackFlow
Tf0883e@RequiresPermissionTb4b4b4(Ta5d6ff"Ta5d6ffandroid.permission.BLUETOOTH_SCANTa5d6ff"Tb4b4b4)
Tff7b72internal Tff7b72fun Te6edf3BluetoothLeScannerTb4b4b4.Td2a8ffscanTb4b4b4(
Te6edf3filtersTb4b4b4: Te6edf3ListTff7b72<Te6edf3ScanFilterTff7b72> Tff7b72= Te6edf3emptyListTb4b4b4(Tb4b4b4)Tb4b4b4,
Te6edf3scanSettingsTb4b4b4: Te6edf3ScanSettings Tff7b72= Te6edf3ScanSettingsTb4b4b4.Te6edf3BuilderTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3buildTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3FlowTff7b72<Te6edf3ScanResultTff7b72> Tff7b72= Te6edf3callbackFlow Tb4b4b4{
Tff7b72val Te6edf3callback Tff7b72= Tff7b72object Tb4b4b4: T56d364ScanCallbackTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72override Tff7b72fun Td2a8ffonScanResultTb4b4b4(Te6edf3callbackTypeTb4b4b4: Tffa657IntTb4b4b4, Te6edf3resultTb4b4b4: Te6edf3ScanResultTb4b4b4) Tb4b4b4{
Te6edf3trySendTb4b4b4(Te6edf3resultTb4b4b4)
Tb4b4b4}
Tff7b72override Tff7b72fun Td2a8ffonScanFailedTb4b4b4(Te6edf3errorCodeTb4b4b4: Tffa657IntTb4b4b4) Tb4b4b4{
Te6edf3cancelTb4b4b4(Ta5d6ff"Ta5d6ffonScanFailed() called with errorCode: Tffd700$Te6edf3errorCodeTa5d6ff"Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3startScanTb4b4b4(Te6edf3filtersTb4b4b4, Te6edf3scanSettingsTb4b4b4, Te6edf3callbackTb4b4b4)
Te6edf3awaitClose Tb4b4b4{ Te6edf3stopScanTb4b4b4(Te6edf3callbackTb4b4b4) Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.11s